"use strict";
/* Controllers */
app.controller("luffyPageController", ['$scope', '$location', '$rootScope', '$routeParams', 'luffyPageService', function ($scope, $location, $rootScope, $routeParams, luffyPageService) {

    var vm = $scope.vm = {};

    vm.p = {};
    vm.result = {};
    vm.p.id = $routeParams.id;
    vm.p.url = '';

    $scope.loadUrl = function (id) {
        var vm = $scope.vm;
        var idxUrl = function(id) {
            if (id == null) {
                return "-";
            }
            switch (id) {
                case "1":// 路飞-分析看板
                    return "https://hrg-luffy.58corp.com/#/analysis/trends";
                    break;
                    break;
                case "2":// 路飞-AB实验
                    return "https://hrg-luffy.58corp.com/#/abtest/data";
                    break;
                case "3":// 路飞-实时洞察
                    return "https://hrg-luffy.58corp.com/#/insight/data";
                    break;
                default:
                    return "https://wuba.xinghuo.58.com/visualization/share/"+id;
                    break;
            }
            return location + url;
        };
        vm.p.url = idxUrl(id);
        console.log(vm.p.url);
    };
    $scope.loadUrl(vm.p.id);
}]);


/* Services */
app.service('luffyPageService', ['ajaxService', function (ajaxService) {

}]);


